home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 4.1 KB | 109 lines | [TEXT/GEOL] |
- Item 3166314 23-Oct-90 12:43PDT
-
- From: PHAROS.TECH Pharos Tech, Tech Staff,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: RE: Printing Headers
-
- From: Schmitz, Scott D. on Tue, Oct 23, 1990 3:43 PM
- Subject: RE: Printing Headers
- To: MacApp
-
- This message was posted a while back. Perhaps it can help.
- _______________________________________________________________________________
- From: FARALLON.ENG on Wed, Aug 29, 1990 8:38 PM
- Subject: Re: Complex Printing
-
- Item 0092384 29-Aug-90 16:04PDT
-
- From: FARALLON.ENG Farallon, Engineering,PRT
-
- To: D4695 Lucas Arts Editing Systems,PRT
- MACAPP.TECH$ MacApp Technical
-
- Sub: Re: Complex Printing
-
- Peter,
-
- I had a very similar need for printing a window with multiple scrollers in my
- application (a regular list view and a palette view that scroll together via
- USynchScroller). Like you, I also looked to the Calc example for help, only to
- find out that it solves the problem by not printing its palette views
- (row/column headers) at all!
-
- What I came up with is to print my palette view in the header section during
- calls to AdornPage. Before calls to TYourView.Draw the page interior is focused
- on, but before calls to AdornPage the exterior (margins) are focused on. Here's
- what I did (it's kind of a hack, but it works):
-
- 1) Create a descendant of TStdPrintHandler (TListPrintHandler) and override its
- AdornPage method.
-
- 2) In your TMainView.IMainView (my TListView.IListView) method create and
- assign this new print handler to the main view:
-
- {Now create a handler for me that will also print my Palette header view}
- New(aListPrintHandler);
- FailNil(aListPrintHandler);
- aListPrintHandler.IStdPrintHandler(itsDocument, SELF, FALSE, TRUE, TRUE);
-
- 3) Because I use minimal margins on my printouts (except for the top, where my
- palette view gets printed), I use the following (immediately following above
- lines) to create header space:
-
- aListPrintHandler.InstallMargins(aRect, TRUE); {Install minimal margins}
- {aRect ignored here}
- DoPagination; {Force recalc of page area}
- aRect := aListPrintHandler.fPageAreas.theMargins; {Get min. margin values}
- aRect.top := 52; {add small margin on top}
- aListPrintHandler.InstallMargins(aRect, FALSE); {Install modified margins}
- DoPagination; {Force recalc of page area}
-
- If you don't normally alter the default margins anyway, you wouldn't have to do
- this, because there would already be header space for your palette view to fit
- in.
-
- 4) Here's my override of the AdornPage method, where the work gets done:
- Note: fView is the view being printed (in my case, TListView); fViewedRect
- is the rect of fView that is being printed at this moment; fListPalView is
- my USynched palette view that I want printed across the top of the page.
-
- {$S APrint}
- Procedure TListPrintHandler.AdornPage; OVERRIDE;
-
- var
- itsTop: integer;
- thePalRect: rect;
-
- begin
- {Create the rect to send to my palette view's draw method}
- itsTop := fPageAreas.theInk.top;
- with thePalRect do
- begin
- left := fViewedRect.left;
- top := itsTop;
- right := fViewedRect.right;
- bottom := itsTop + gOurDocument.fListPalView.fSize.v;
- end;
- if gOurDocument.fListPalView.Focus then
- begin
- SetOrigin(thePalRect.left, thePalRect.top); {so multi-page printing works}
- SetRect(thePalRect, 0, 0, 32000, 32000);
- ClipRect(thePalRect); {open up clipping}
- gOurDocument.fListPalView.Draw(thePalRect); {draw our palette view!}
- end;
- if fView.Focus then; {restore proper focus}
- end;
-
- This works like a charm. Note that this works for my view, which has a single
- synced header view and not a side view like Calc has. But, with slight
- modification this would also work for Calc's side palettes.
-
- Hope this helps...
-
- Eric Knight
- Farallon Computing
-
-
-